#include<iostream>
#include<sys/types.h>
#include<unistd.h>
#include<signal.h>
using namespace std;
void handler(int signo)
{
	cout << "get a signal: " << signo << endl;
}
int main()
{
	signal(2,handler);
	while(1)
	{
		cout << "I am a process: " << getpid() << endl;
		sleep(1);
	}
	return 0;
}
